package com.hy.domain;

public class C {

	private String name;
	private int age;

	public C() {
		this.name = "我是通过 C 的无参构造方法创建的!";
	}

	public C(String name, int age) {
		this.name = name;
		this.age = age;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public static C buildBean(){
		System.out.println(C.class + ".buildBean()");

		C c = new C();
		c.setName("通过工厂静态无参方法创建!");
		return c;

	}
	@Override
	public String toString() {
		return "C{" +
				"name='" + name + '\'' +
				", age=" + age +
				'}';
	}
}
